var toTop=document.querySelector("#toTop");

window.onscroll=function(){
    if (document.documentElement.scrollTop>1000||document.body.scrollTop>1000){
        toTop.style.display="block";
    } else {
        toTop.style.display="none";
    }
};

toTop.addEventListener('click',function(){
    //滚动到指定的位置
    //支持老版本的浏览器
    window.scrollTo(0,0);
    //支持新版本的浏览器
    window.scrollTo({
        top:0,
        behavior:'smooth'
    })
});

var yiru=document.querySelector("#yiru");
var yichu=document.querySelector("#yichu");
yiru.addEventListener("mouseover",function(){
    yichu.style.display="block"
});
yiru.addEventListener("mouseleave",function(){
    yichu.style.display="none";
});
yichu.addEventListener("mouseover",function(){
    yichu.style.display="block";
});
yichu.addEventListener("mouseleave",function(){
    yichu.style.display="none";
});

function zan(){
    var num=document.querySelector("#zan1").innerHTML;
    num=Number(num);
    document.querySelector("#zan1").innerHTML=num+1;

}
